//
//  SectionHeaderView.m
//  digitalCurrency
//
//  Created by 默认账户 on 2019/4/3.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "SectionHeaderResuView.h"

@implementation SectionHeaderResuView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createviews];
    }
    return self;
}

- (void)createviews {
    UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(-15, 20, 100, 28)];
    bgview.backgroundColor = [UIColor colorWithHEX:mainBlackColor];
    bgview.layer.cornerRadius = 14;
    [self addSubview:bgview];
    
    [bgview addSubview:self.titleLabel];
    [bgview addSubview:self.titleImgView];
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 6, 50, 15)];
        _titleLabel.text = LocalizationKey(@"appicon");
        _titleLabel.font = [UIFont systemFontOfSize:15];
        _titleLabel.textColor = [UIColor colorWithHEX:maincolor];
    }
    
    return _titleLabel;
    
}

- (UIImageView *)titleImgView {
    if (!_titleImgView) {
        _titleImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"media"]];
        _titleImgView.frame = CGRectMake(25, 6, 15, 15);
    }
    
    return _titleImgView;
}

@end
